#include <stdio.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
#include <string.h>


int main()
{
	int i=0;
	char buf[4]={0};
	int fd;
	
	fd = open("/dev/a53_led_drive",O_RDWR);
	if(fd < 0)
	{
		perror("open failed");
		return 0;
	}
	while(1){
	buf[0] = 1;
	buf[3] = 0;
	write(fd,buf,sizeof(buf));
	sleep(1);
	buf[0] = 0;
	buf[1] = 1;
	write(fd,buf,sizeof(buf));
	sleep(1);
	buf[0] = 0;
	buf[1] = 0;
	buf[2] = 1;
	write(fd,buf,sizeof(buf));
	sleep(1);
	buf[0] = 0;
	buf[1] = 0;
	buf[2] = 0;
	buf[3] = 1;
	write(fd,buf,sizeof(buf));
	sleep(1);

	}
	memset(buf,0,sizeof(buf));
	read(fd,buf,sizeof(buf));

	printf("buf = %s\n",buf);
	close(fd);
	return 0;
}


